<template>
  <div class="home">
    <div class="server-form">
      <h1>FHIR服务器</h1>
      <div>
        <Input v-model="fhirServer" placeholder="FHIR服务器地址"></Input>
        <div style="margin-top: 10px">
          <Button type="primary" @click="setServer">确定</Button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'home',
    data() {
      return {
        fhirServer: ''
      }
    },
    created(){
      this.fhirServer = this.$store.state.base.fhirServer;
    },
    methods: {
      setServer() {
        if (this.fhirServer) {
          this.$store.commit('initServer', {fhirServer: this.fhirServer})

          this.$Message.success("设置成功，可进行后续操作")
        }
      }
    }
  }
</script>

<style scoped>

</style>
